import type { MonitorStatus, PredictionResponse } from '@/types/sleepMonitor';
import type { CommonResponse } from '@/types/response';
// 导入项目标准请求模块
import request from '@/utils/request/request';

// 开始睡眠监测
export const startMonitor = (): Promise<CommonResponse<{ reportId: number }>> => 
  request.post('/sleep/monitor/start');

// 暂停睡眠监测
export const pauseMonitor = (reportId: number): Promise<CommonResponse<void>> => 
  request.delete(`/sleep/monitor/pause/${reportId}`);

// 分析睡眠阶段
export const analyzeStage = (reportId: number, eegData: number[]): Promise<CommonResponse<void>> => 
  request.put(`/sleep/monitor/analyze/${reportId}`, eegData);

// 获取当前当天状态
export const getSleepMonitorStatus = (): Promise<CommonResponse<MonitorStatus>> => 
  request.get('/sleep/monitor/status');
